package com.guchenbo.example.thread;

import java.io.File;

/**
 * @author guchenbo
 * @date 2024/12/15
 */
public class Tmp {
    public static void main(String[] args) {
        String path = "/Users/guchenbo/Downloads/周杰伦魔天伦世界巡回演唱会";
        File file = new File(path);
                for (File listFile : file.listFiles()) {
                    String name = listFile.getName();
                    System.out.println(name);
                    String[] split = name.split(" ");
                    String newName = String.join("", split);
                    System.out.println(newName);
                    listFile.renameTo(new File(path + "/" + newName));
                }

//        for (File listFile : file.listFiles()) {
//            String name = listFile.getName();
//            if (name.equals(".DS_Store")) {
//                continue;
//            }
//            System.out.println(name);
//            String last = StringUtils.substringAfter(name, ".");
//            String first = StringUtils.substringBefore(name, ".");
//            int no = Integer.parseInt(first) + 35;
//            String newName = no + "." + last;
//            System.out.println(newName);
//                        listFile.renameTo(new File(path + "/" + newName));
//        }
    }
}
